﻿using Bids.Core.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.OpenAccess;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;
namespace Bids.Core.DomainObjects
{
	/// <summary>
	/// 发件箱
	/// </summary>
	[Serializable]
    public class OutBox : IEntity
	{
		
		/// <summary>
		/// 
		/// </summary>
        public virtual int ID { set; get; }
		/// <summary>
		/// 收件人
		/// </summary>
        public virtual string Receiver { set; get; }
		/// <summary>
		/// 发件人Id
		/// </summary>
        public virtual int UserId { set; get; }
		/// <summary>
		/// 标题
		/// </summary>
        public virtual string Title { set; get; }
		/// <summary>
		/// 正文
		/// </summary>
        public virtual string Content { set; get; }
		/// <summary>
		/// 时间
		/// </summary>
        public virtual DateTime CreateTime { set; get; }
		


        public static MappingConfiguration<OutBox> CreateConfiguration()
        {
            var threadMapping = new MappingConfiguration<OutBox>();
            threadMapping.MapType(t => new
            {
                t.ID,
                t.Receiver,
                t.UserId,
                t.Title,
                t.Content,
                t.CreateTime
              
            }).ToTable("OutBoxes");
            threadMapping.HasProperty(t => t.ID).IsIdentity(KeyGenerator.Autoinc);
            return threadMapping;
        }
	}

}

